package homework_04;

import java.util.Arrays;

/**
 * 将一个数组中的元素逆序存放。
 */
public class Home_07 {
    public static void DaoXu(int[] a) {
        int i=0;
        int n=a.length-1;
        while(n>2*i){
            int x=a[i];
            a[i]=a[n-i];
            a[n-i]=x;
            i++;
        }

    }
    public static void main(String[] args) {
        int[] a={1,2,3,4,5,6,7,8,9};
        DaoXu(a);
        System.out.println(Arrays.toString(a));
    }
}
